package org.inspursc.s0517.health.evaluation.dao;

import org.inspursc.s0517.health.evaluation.entity.ReportShare;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Date;

/**
 * @author yuchu
 */
public interface ReportShareDao extends JpaRepository<ReportShare,Integer> {

    /**
     * 通过报告ID，密码和有限时间，查询报告
     * @param reportId
     * @param pass
     * @param date
     * @return
     */
    ReportShare findByReportIdAndPassAndDateGreaterThanEqual(int reportId, String pass, Date date);

    /**
     * 根据报告ID，和有限时间，获取报告
     * @param reportId
     * @param date
     * @return
     */
    ReportShare findByReportIdAndDateGreaterThanEqual(int reportId,Date date);
}
